#include <iostream>
using namespace std;

int main()
{
  cout << "Enter an uppercase letter: ";
  char ch;
  cin >> ch;

  int number;
  switch (ch)
  {
    case 'A':
    case 'B':
    case 'C': number = 2; break;
    case 'D':
    case 'E':
    case 'F': number = 3; break;
    case 'G':
    case 'H':
    case 'I': number = 4; break;
    case 'J':
    case 'K':
    case 'L': number = 5; break;
    case 'M':
    case 'N':
    case 'O': number = 6; break;
    case 'P':
    case 'Q':
    case 'R':
    case 'S': number = 7; break;
    case 'T':
    case 'U':
    case 'V': number = 8; break;
    case 'W':
    case 'X':
    case 'Y':
    case 'Z': number = 9; break;
    default: cout << "Invalid input " << endl; return 0;
  }

  cout << "The corresponding number is " << number << endl;
  return 0;
}
